;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@AutoStoreMain]
{
#IF
#SAY
Hi, I am the AutoStore Merchant\
How can I help you?\\

<[ Store Booty ]/@StoreBootyWarn>\
<[ Exit ]/@Exit>\\\

[@StoreBootyWarn]
#ACT
Mov A0 %USERNAME
FormatStr "FLD_CHARACTER='%s'" %USERNAME
#SAY
This feature will run through the booty available\
in game and automatically store it for you.\\
This may take a couple of minutes to run, please be\
 patient.\\

<[ Continue ]/@StoreBooty>\
<[ Exit ]/@exit>\\\

[@StoreBooty]
#IF
CheckItem SpiderTooth 1
#ACT
Mov A1 "SpiderTooth"
Mov A2 "FLD_VAR1"
ReadValueSQL "TBL_BootyStore" %A9 %A2 [@StoreItem]
Break
#IF
CheckItem CannibalPlantFruit 1
#ACT
Mov A1 "CannibalPlantFruit"
Mov A2 "FLD_VAR2"
ReadValueSQL "TBL_BootyStore" %A9 %A2 [@StoreItem]
Break
#IF
CheckItem ScorpionTail 1
#ACT
Mov A1 "ScorpionTail"
Mov A2 "FLD_VAR3"
ReadValueSQL "TBL_BootyStore" %A9 %A2 [@StoreItem]
Break
#ELSESAY
You have no booty to store\

<[ Exit ]/@Exit>\\\

[@StoreBootyPass2]
#IF
CheckItem SpiderTooth 1
#ACT
Mov A0 %USERNAME
FormatStr "FLD_CHARACTER='%s'" %USERNAME
GoTo @StoreSpiderTooth
#ELSESAY
All booty stored.\\

<[ Exit ]/@Exit>\\\

[@StoreSpiderTooth]
#ACT
Mov A1 "SpiderTooth"
Mov A2 "FLD_VAR1"
ReadValueSQL "TBL_BootyStore" %A9 %A2 [@StoreItem]

[@StoreItem()]
#SAY
Storing <$OUTPUT(A1)>...\\
Please wait...\\

#ACT
Mov D0 %ARG(1)
Inc D0 1
Mov A8 %A9
Take %A1 1
Mov A3 %A2
AddStr A3 "='"
AddStr A3 %D0
AddStr A3 "'"
UPDATEVALUESQL "TBL_BootyStore" %A8 %A3
DelayGoto [local] 1 @StoreBooty

}